package main

import (
	"go.uber.org/zap"
	"google.golang.org/grpc"
	"mxshop_srvs/goods_srv/proto"
	"mxshop_srvs/goods_srv/tests"
)

import (
	"context"
	"fmt"
)

func TestBatchGetGoods() {
	Ids := []int32{1, 2}
	rsp, err := tests.Client.BatchGetGoods(context.Background(), &proto.BatchGoodsIdInfo{
		Id: Ids,
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(rsp.Total)
	for _, good := range rsp.Data {
		fmt.Println(good.Name)
	}
}

func main() {
	tests.Init()
	TestBatchGetGoods()
	defer func(Conn *grpc.ClientConn) {
		err := Conn.Close()
		if err != nil {
			zap.S().Errorf("conn.close错误")
		}
	}(tests.Conn)

}
